<template>
	<view :class="{bg141414:theme}" style="min-height: 100vh;">
		
	<view v-if="url">
		<web-view :src="url"></web-view>
	</view>
	<view v-else class="con size14" style="font-size: 24rpx;">
		<!-- <back :title="title"></back> --> 
		<view class="mmtn pb10" style="color: #999;">
			<rich-text :nodes="page"></rich-text>
		</view>  
	</view> 
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isload: false,
				url: "",
				page: '',
				type:"",
				title: "",
				type:"",
				theme: uni.getStorageSync('theme'),
			}
		},
		onLoad(option) {
			
			this.type=option.type
			if(option.url){
				this.url = option.url
				return
			}else if(option.jiang){
				this.page = uni.getStorageSync('jiang')
				uni.setNavigationBarTitle({
					title: '活动规则'
				})
				return
			}
			let url = ''
			if (option.xieyis == 1) {
				url = 'setting/user_statement'
			} else if (option.xieyis == 2) {
				url = 'setting/privacy_policy'
			} else if (option.xieyis == 3) {
				url = 'setting/hof_agreement'
			}
			this.http(url).then(res => {
				this.page = res.data.setting.modules[0].html
				this.title = res.data.setting.title
				uni.setNavigationBarTitle({
					title: res.data.setting.title
				})
			})
		},
		mounted() {
			if(this.type==2){
				uni.setNavigationBarTitle({
					title: '火莲神签'
				})
				
				uni.setNavigationBarColor({
				    frontColor: '#ffffff',
				    backgroundColor: '#101217'
				})
			}else if(this.type==1){
				uni.setNavigationBarTitle({
					title: '客服系统'
				})
				uni.setNavigationBarColor({
				    frontColor: '#ffffff',
				    backgroundColor: '#333333'
				})
			}else if(this.type==3){
				uni.setNavigationBarTitle({
					title: '火莲展厅'
				})
				uni.setNavigationBarColor({
				    frontColor: '#ffffff',
				    backgroundColor: '#333333'
				})
			}else if(this.type==4){
				uni.setNavigationBarTitle({
					title: '火莲官网'
				})
				uni.setNavigationBarColor({
				    frontColor: '#ffffff',
				    backgroundColor: '#190b0a'
				})
			}
		},
		methods: { 
		}
	}
</script>

<style>
	page {
		padding-top: 0;
		line-height: 1.4;
	}

	.mmtn {
		padding-top: 10px;
		padding-bottom: 10px;
	}
</style>